package com.niiwoo.civet.trade.dao.mapper.credit;

import com.niiwoo.civet.trade.dao.entity.credit.CreditProjectRepayment;
import com.niiwoo.civet.trade.dao.entity.credit.CreditSumProjectRepayment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CreditProjectRepaymentMapperExt extends CreditProjectRepaymentMapper {

    /**
     * 查询项目某期的还款计划
     * @param creditProjectRepayment
     * @return
     */
    CreditProjectRepayment selectByProjectIdAndPeriods(CreditProjectRepayment creditProjectRepayment);


    /**
     * 查询项目大于等于某期的还款计划列表
     * @param creditProjectRepayment
     * @return
     */
    List<CreditProjectRepayment> selectByProjectIdAndPeriodsList(CreditProjectRepayment creditProjectRepayment);
    /**
     * @Title: selectLastPeriodsByProjectId
     * @Description: 根据项目ID查询最后一期还款计划。
     * @param projectId
     * @return ProjectrePayment    返回类型
     */
    CreditProjectRepayment selectLastPeriodsByProjectId(@Param("projectId") Long projectId);

    /**
     * @Title: selectOneByConditions
     * @Description: 根据条件查询总计数
     * @param projectId
     * @return ProjectrePayment    返回类型
     */
    CreditSumProjectRepayment selectSumByProjectId(@Param("projectId") Long projectId);

    /**
     * @Title: selectOneByConditions
     * @Description: 根据条件查询还款计划
     * @param projectId
     * @return ProjectrePayment    返回类型
     */
    List<CreditProjectRepayment> selectByProjectId(@Param("projectId") Long projectId);
    /**
     * @Title: selectOneByConditions
     * @Description: 根据条件查询坏账第一期
     * @param projectId
     * @return CreditProjectRepayment    返回类型
     */
    CreditProjectRepayment selectFirstPeriodBadDebt(@Param("projectId") Long projectId);
    /**
     * @Title: selectOneByConditions
     * @Description: 根据条件查询坏账时的总计数
     * @param projectId
     * @return ProjectrePayment    返回类型
     */
    CreditSumProjectRepayment selectSumByBadDebt(@Param("projectId") Long projectId);

}


